#!/bin/bash

max_dp=10
setup=1
num=`ls /a-boat/boat-bak-*tar.bz -ltr |awk -F" " '{print $9}' | wc -l`

while test $num -gt 2 -a $max_dp -gt 1
do
	echo "rm " `ls /a-boat/boat-bak-*tar.bz -ltr |awk -F" " '{print $9}' | head -n 1`

	num=`ls /a-boat/boat-bak-*tar.bz -ltr |awk -F" " '{print $9}' | wc -l`
	ls /a-boat/boat-bak-*tar.bz -ltr |awk -F" " '{print $9}' | head -n 1 | xargs rm
	max_dp=`expr $max_dp - $setup`
done
